home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tchk21.arc / INCLUDE.ARC / DOSHK.H < prev    next >
C/C++ Source or Header  |  1989-06-20  |  6KB  |  102 lines

  1. /* TCHK 2.1 - Howard Kapustein's Turbo C library        6-6-89      */
  2. /* Copyright (C) 1988,1989 Howard Kapustein.  All rights reserved.  */
  3.  
  4. /* doshk.h  -  header file for DOSHK.C - DOS routines */
  5.  
  6. #ifndef DOSHK_HEADER
  7. #define DOSHK_HEADER    1
  8.  
  9. #include <howard.h>
  10.  
  11. typedef struct BIOSParmBlock {              /* BIOS Parameter Block */
  12.             unsigned int BytesPerSector;         /* bytes per sector */
  13.             byte         SectorsPerAllocUnit;    /* sectors per cluster */
  14.             unsigned int ReservedSectors;        /* reserved sectors (for boot record) */
  15.             byte         numberFATs;             /* number of FAT copies */
  16.             unsigned int numberRootDirEntries;   /* number of root directory entries */
  17.             unsigned int TotalSectors;           /* total number of sectors */
  18.             byte         MediaDescriptor;        /* media desriptor byte */
  19.             unsigned int SectorsPerFAT;          /* sectors per FAT */
  20.         };
  21.  
  22. typedef struct BootBlock {                  /* Boot Block */
  23.             byte JumpInstr[3];
  24.             byte OEMinfo[8];
  25.             struct BIOSParmBlock BPB;
  26.             unsigned int SectorsPerTrack;        /* sectors per track */
  27.             unsigned int numberHeads;            /* number of heads (sides) */
  28.             unsigned int numberHiddenSectors;    /* number of hidden sectors */
  29.         };
  30.  
  31. typedef struct BootBlock4 {                 /* Boot Block (DOS 4.x) */
  32.             byte JumpInstr[3];
  33.             byte OEMinfo[8];
  34.             struct BIOSParmBlock BPB;
  35.             unsigned int SectorsPerTrack;        /* sectors per track */
  36.             unsigned int numberHeads;            /* number of heads (sides) */
  37.             unsigned long numberHiddenSectors;   /* number of hidden sectors */
  38.             unsigned long TotalnumberSectors;    /* total number of sectors */
  39.             byte Physicaldrive;                  /* physical drive number */
  40.             byte reserved1[1];                   /* (reserved - 1 byte) */
  41.             byte Signaturebyte;                  /* signature byte (shoud be 0x29) */
  42.             unsigned long VolumeSerialNumber;    /* volume serial number */
  43.             char VolumeLabel[11];                /* volume label */
  44.             byte reserved2[8];                   /* (reserved - 8 bytes) */
  45.         };
  46.  
  47. /* Format prototypes */
  48. boolean getBPB(int drive, struct BIOSParmBlock *BPB);    /* get BIOS Parameter Block (A=0, B=1,...) */
  49. boolean getBootBlock(int drive, struct BootBlock *BB);   /* get Boot Block */
  50. boolean getBootBlock4(int drive, struct BootBlock4 *BB4);/* get Boot Block (DOS 4.x) */
  51. boolean getVolSerialNum(int drive, unsigned long *serialnum);   /* get volume serial number (DOS 4.x) */
  52.  
  53. /* Memory prototypes */
  54. int memory_strategy(boolean read, int *strategy);        /* get/set mem alloc strategy */
  55. boolean isXMSinstalled(void);           /* is XMS installed */
  56.  
  57. /* Software prototypes */
  58. boolean isAssignavail(void);            /* is ASSIGN installed */
  59. unsigned getAssignmemseg(void);         /* get segment of ASSIGN work area */
  60. boolean isAppendavail(void);            /* is APPEND installed */
  61. boolean isVidclock(void);               /* is VIDCLOCK.COM installed */
  62. boolean isScrnSav2(void);               /* is SCRNSAV2.COM installed */
  63. boolean isAutoPark(void);               /* is AUTOPARK.COM installed */
  64. void setAutoPark(unsigned long count);  /* set parking delay, count * 55ms timer ticks */
  65. int isShareavail(void);                 /* is SHARE installed */
  66. boolean isCEDavail(void);               /* is CED installed */
  67. boolean CEDremove(char *command);       /* delete/remove installable command */
  68. boolean CEDadd(char *command, unsigned char mode, unsigned segment, unsigned offset);   /* add CED installable command */
  69. boolean ispcAnywhere(void);             /* is pcAnywhere installed */
  70. void SetpcAnywhere(boolean enabled);    /* Enable/Disable pcAnywhere */
  71. unsigned char isDriverSys(void);        /* is Driver.Sys installed */
  72. unsigned char isNLSFuncCom(void);       /* is NLSFUNC.COM installed */
  73. boolean isWhoa(void);                   /* is WHOA!.COM installed */
  74. boolean uninstallWhoa(void);            /* uninstall WHOA!.COM */
  75. boolean setWhoa(unsigned int delaycount);   /* set delay count for WHOA!.COM */
  76. boolean isAnarkey(void);                /* is ANARKEY.COM installed */
  77.  
  78. /* Device prototypes */
  79. int isremovable(char drive);            /* is device fixed */
  80. int iscdevicemoderaw(int handle);       /* is character device in "raw"/binary or "cooked" mode */
  81. int setcdevicemode(int handle, boolean setraw); /* set character device to "raw"/binary mode ? */
  82. int ishandlelocal(int handle);          /* is handle local (MSNetwork) or remote (redirected to server) */
  83. int isdrivelocal(int drive);            /* is drive local (MSNetwork) or remote (redirected to server) */
  84. boolean isRedirectStdin(void);          /* is stdin redirected */
  85. boolean isRedirectStdout(void);         /* is stdout redirected */
  86.  
  87. /* DOS prototypes */
  88. boolean commit(int handle);             /* flush disk buffer for a handle */
  89. char *resolvepath(char *str, char *buffer); /* resolve a path to a fully qualified path (DOS 3.x) */
  90.  
  91. /* DOS date/time stamp macros */
  92. #define doshour(h)          ((h & 0xF800) >> 11)
  93. #define dosmin(m)           ((m & 0x07E0) >> 5)
  94. #define dossec(s)           (s & 0x001F)
  95. #define todostime(h,m,s)    (((h << 11) & 0xF800) | ((m << 5) & 0x07E0) | (s & 0x001F))
  96. #define dosyear(y)          ((y & 0xFE00) >> 9)
  97. #define dosmonth(m)         ((m & 0x01E0) >> 5)
  98. #define dosday(d)           (d & 0x001F)
  99. #define todosdate(y,m,d)    (((y << 9) & 0xFE00) | ((m << 5) & 0x01E0) | (d & 0x001F))
  100.  
  101. #endif              /* DOSHK_HEADER */
  102.